package atom.loader.core {
	import atom.loader.IAsset;
	import atom.loader.ILoader;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.net.URLRequest;
	
	/**
	 * ...
	 * @author Jorge Braccini
	 */
	public class AbstractLoader extends EventDispatcher implements ILoader {
		
		protected var _url:URLRequest;
		protected var _id:String;
		protected var _ready:Boolean = false;
		
		public function AbstractLoader(id:String, url:String = null) {
			_id = id;
			if(url) _url = new URLRequest(url);
		}
		
		public function load():void {
			throw new Error("Not implemented.");
		}
		
		public function cancel():void {
			throw new Error("Not implemented.");
		}
		
		public function reload():void {
			throw new Error("Not implemented.");
		}
		
		public function destroy():void {
			throw new Error("Not implemented.");
		}
		
		protected function init():void {
			
		}
		
		public function get ready():Boolean { return _ready; }
		
		protected function redispatch(e:Event):void {
			dispatchEvent(e.clone());
		}
		
	}

}